﻿@model Bricks.Site.Models.HolidayRequestView
@{
    ViewBag.Title = "HolidayRequestList";
    Layout = "~/Views/Shared/_UserPage.cshtml";
}

<script type="text/javascript">
    $(function () {
        //当页面首次刷新的时候执行的事件
        initTable();
    });

    function initTable() {
        $('#myDataGrid').datagrid({
            url: '/HolidayRequest/GetHolidayRequestList',
            iconCls: 'icon-bricks',
            nowrap: true,
            autoRowHeight: false,
            striped: true,
            collapsible: true,
            pagination: true,
            pageSize: 20,
            rownumbers: true,
            remoteSort: false,
            idField: 'ID',
            singleSelect: true,
            columns: [[
                        { title: 'id', field: 'id', hidden: true },
                        {
                            title: '请假理由', field: 'RequestReason', width: 550,
                            formatter:
                            function (value, row, index) {
                                return '<a href="#" onclick=PopHolidayRequest("' + row.ID + '")>' + row.RequestReason + '</a>';
                            }
                        },
                        { title: '请假开始时间', field: 'RequestStartDate', width: 150, sortable: true, formatter: function (value, rec) { if (value) { return dateConvert(value); } } },
                        { title: '请假结束时间', field: 'RequestEndDate', width: 150, sortable: true, formatter: function (value, rec) { if (value) { return dateConvert(value); } } },
                        { title: '填写日期', field: 'RequestDate', width: 150, sortable: true, formatter: function (value, rec) { if (value) { return dateConvert(value); } } },
                      ]]
        });
    }

    function PopHolidayRequest(id)
    {
        showMyWindow("请假流程", "/HolidayRequest/HolidayRequest?processID=" + id, 700, 600, true, true);
    }
</script>

<div class="easyui-panel" @Html.Raw(ViewBag.PanelInfo)>
    <table id="myDataGrid" fit="true"></table>
</div>
